# TiDB Configuration.

{% for item, value in tidb_conf.global | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[log]
{% for item, value in tidb_conf.log | dictsort_by_value_type -%}
{% if value is not mapping -%}
{{ item }} = {{ value | to_json}}
{% else %}

[log.{{ item }}]
{% for sub_item, sub_value in value | dictsort -%}
{{ sub_item }} = {{ sub_value | to_json }}
{% endfor %}
{% endif %}
{% endfor %}

[security]
{% for item, value in tidb_conf.security | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[status]
{% for item, value in tidb_conf.status | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[performance]
{% for item, value in tidb_conf.performance | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[proxy-protocol]
{% for item, value in tidb_conf.proxy_protocol | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[prepared-plan-cache]
{% for item, value in tidb_conf.prepared_plan_cache | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[opentracing]
{% for item, value in tidb_conf.opentracing | dictsort_by_value_type -%}
{% if value is not mapping -%}
{{ item }} = {{ value | to_json }}
{% else %}

[opentracing.{{ item }}]
{% for sub_item, sub_value in value | dictsort -%}
{{ sub_item }} = {{ sub_value | to_json }}
{% endfor %}
{% endif %}
{% endfor %}

[tikv-client]
{% for item, value in tidb_conf.tikv_client | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[txn-local-latches]
{% for item, value in tidb_conf.txn_local_latches | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}

[binlog]
{% if binlog_version == 'kafka' and enable_binlog == True %}
binlog-socket = "{{ pump_socket }}"
{% endif %}
{% for item, value in tidb_conf.binlog | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}
